# \project_v1\app\models\request.py
from sqlalchemy import Column, String, Integer
from app.models.base import Base
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

class Request(Base):
    RequestID = Column(Integer, primary_key=True, autoincrement=True)
    A_ID = Column(Integer, nullable=True)  # 根据需要调整长度
    CourseCategory = Column(String(50), nullable=True)  # 根据需要调整长度
    CourseName = Column(String(50), nullable=True)
    EID = Column(Integer, nullable=True)
    Explanation = Column(String(3000), nullable=True)
    ScoreUpdateCount = Column(Integer, nullable=True)  # 根据需要调整长度
    Request_Type = Column(String(20), nullable=False)  # ADD_COURSE, UPDATE_SCORE
    Approve_Type = Column(String(20), nullable=False)  # 三种状态wait, reject, pass
    T_id=Column(Integer,nullable=True)


    def __init__(self, RequestID=None, A_ID=None, CourseCategory=None, CourseName=None, EID=None, Explanation=None, ScoreUpdateCount=None, Request_Type=None, Approve_Type='wait',T_id=None):
        super(Request, self).__init__()
        self.RequestID = RequestID
        self.A_ID = A_ID
        self.CourseCategory = CourseCategory
        self.CourseName = CourseName
        self.EID = EID
        self.Explanation = Explanation
        self.ScoreUpdateCount = ScoreUpdateCount
        self.Request_Type = Request_Type
        self.Approve_Type = Approve_Type
        self.T_id=T_id
